#include "command.h"

int _hi(char *argv[]) {
	/* check the number of cmd-line parameters is correct */
	int argc = 0;
	for (char **ptr = argv; *ptr != NULL; ptr++)
		argc++;

	if (argc > 2 || (argc == 2 && strcmp(argv[1], "joky") != 0)) {
		fprintf(stderr, "Usage: hi [joky]\n");
		return -1;
	}

	printf(BLUE        "               _            	\n" RESET);
	printf(CYAN        "     _        ( )           	\n" RESET);
	printf(GREEN       "    (_)   _   | |/')  _   _ 	\n" RESET);
	printf(YELLOW      "    | | /'_`\\ | , <  ( ) ( ) 	\n" RESET);
	printf(RED         "    | |( (_) )| |\\`\\ | (_) | 	\n" RESET);
	printf(MAGENTA     " _  | |`\\___/'(_) (_)`\\__, | 	\n" RESET);
	printf(BLUE        "( )_| |              ( )_| | 	\n" RESET);
	printf(CYAN        " `\\___/'              `\\___/' \n" RESET);

	printf("\n    %sWelcome %sto %sJOKY %s%s%s\n\n\n", YELLOW, GREEN, MAGENTA, RED, JOKY_VERSION, RESET);

	return 0;
}
